package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.ProductManageActivity;
import com.wwtech.epp.ui.activity.work.contract.ProductManageContract;
import com.wwtech.epp.ui.activity.work.presenter.ProductManagePresenter;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of ProductManageActivity, provide field for ProductManageActivity
 * @date 2017/09/01 09:59:00
 */
@Module
public class ProductManageModule {
    private final ProductManageContract.View mView;


    public ProductManageModule(ProductManageContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public ProductManagePresenter provideProductManagePresenter(HttpAPIWrapper httpAPIWrapper, ProductManageActivity mActivity) {
        return new ProductManagePresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public ProductManageActivity provideProductManageActivity() {
        return (ProductManageActivity) mView;
    }
}